package net.rlair.sbdemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @author lixudong
 */
@Controller
@RequestMapping("/index")
public class IndexController {

    @GetMapping("")
    public String index(Model model) {
        model.addAttribute("welcome", "使用freemark模板渲染");
        return "index";
    }

    @GetMapping("data")
    @ResponseBody
    public Object data() {
        return "数据";
    }
}
